function XForms_instance(params,childNodes){
  XForms_Core.call(this, params);
  XForms.instances.push(this);
  var control=this;
  function loadChildNodes(base,arr){
    if(!arr) return;
    var chs=[];
    for(var i=0,l=arr.length;i<l;i++) {
      var ch = arr[i];
      var pa = {_xpath:base + '/' + ch._nodeName,_nodeName:ch._nodeName,_instance:control};
      if(ch._childNodes.length==1 && !ch._childNodes[0]._nodeName) {
        pa.value=ch._childNodes[0];
        chs.push(new XForms_data(pa, []));
      } else {
        var xch = loadChildNodes(base + '/' + ch._nodeName, ch._childNodes);
        chs.push(new XForms_data(pa, xch));
      }
    }
    return chs;
  }
  this.childNodes = loadChildNodes(params._xpath, childNodes);
}
